#ifdef _WIN32
#include <windows.h>
#else
#include <sys/mman.h>   // For mmap on Linux/Unix systems
#include <unistd.h>     // For close on Linux
#endif
namespace security_MmapWriteExec {
void test(int n) {
#ifdef _WIN32
    // In Windows, use VirtualAlloc instead of mmap
    void* c = VirtualAlloc(NULL, 32, MEM_COMMIT | MEM_RESERVE, PAGE_EXECUTE_READWRITE);
    if (c == NULL) {
        // Handle allocation failure
    }
#else
    // In Linux/Unix, use mmap
    void* c = mmap(NULL, 32, PROT_READ | PROT_WRITE | PROT_EXEC,
        MAP_PRIVATE | MAP_ANON, -1, 0);
    if (c == MAP_FAILED) {
        // Handle mmap failure
    }
#endif
}
}